// 统一管理用户相关的接口
import request from '@/utils/request'

// 项目用户相关的请求地址
const API = {
    LOGIN_URL: '/login',
    USERINFO_URL: '/info',
    LOGOUT_URL: '/logout',
    CODE_URL: '/checkCode',
    GET_ROUTER_URL: '/getRouters',
}

// 登录接口
export const reqLogin = (data) =>
    request.post(API.LOGIN_URL, data)

// 注册
export const register = (data) =>
    request.post('/register', data)

// 获取用户信息
export const reqUserInfo = () =>
    request.get(API.USERINFO_URL)

// 退出登录
export const reqLogout = () => request.post(API.LOGOUT_URL)

// 验证码接口
export const checkCode = () => request.get(API.CODE_URL)

// 获取路由接口
export const getRouters = (menuName) => request.get(API.GET_ROUTER_URL, {params: {menuName: menuName}})

